<?php

	session_start();
	require_once('classes/libs/ExtDirect/API.php');
	require_once('classes/libs/ExtDirect/CacheProvider.php');

	$cache = new ExtDirect_CacheProvider('cache/api_cache.txt');
	$api = new ExtDirect_API();

	$api->setRouterUrl('router.php'); // default
	$api->setCacheProvider($cache);

	$api->setDefaults(array('autoInclude' => true,'basePath' => 'classes'));
	$api->add( 'System_Functions' );

	$api->setDefaults(array('autoInclude' => true,'basePath' => 'classes/classes_direct'));
	$api->add( 'DirectProduct' );
	$api->add( 'DirectRequest' );
	
	/*if( !isset($_SESSION['user_member']) or $_SESSION['user_member'] == '' )
		$api->add( array('System_Users') );
	else
		$api->add( array('System_Users','System_Menu','System_Functions', 'System_Administrator') );
	*/
	
	$api->output();

	$_SESSION['ext-direct-state'] = $api->getState();
	
?>